<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use backend\models\User;
use backend\models\Group;
use yii\helpers\ArrayHelper;

/* @var $this yii\web\View */
/* @var $model backend\models\User */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="user-form">
   
    <?php 
        $form = ActiveForm::begin([
            'options'=>['class' => 'form-horizontal', 'enctype'=>'multipart/form-data'],
            'fieldConfig' => [
                'template' => "{label}\n<div class=\"col-lg-4\">{input}</div>\n<div class=\"col-lg-4\">{error}</div>",
                'labelOptions' => ['class' => 'col-lg-2 control-label'],
            ],
        ]); 
    ?>
    <?= $form->field($model, 'username')->textInput(['maxlength' => 255]) ?>

    <?= $form->field($model, 'password')->passwordInput(['maxlength' => 255]) ?>

    <?= $form->field($model, 'repassword')->passwordInput(['maxlength' => 255]) ?>
    
     <?= $form->field($model, 'group_id')->dropDownList(Group::getArrayGroup()) ?>

    <?= $form->field($model, 'email')->textInput(['maxlength' => 255]) ?>

    <?php //$form->field($model, 'role',['type'=>'text'])->dropDownList(User::getArrayRole()) ?>

    <?= $form->field($model, 'status')->dropDownList(User::getArrayStatus()) ?>
  
    <div class="form-group">
        <label class="col-lg-2 control-label" for="">&nbsp;</label>
        <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>
    <?php ActiveForm::end(); ?>

</div>
